home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Nov 90 / MacApp.Tech$ 11⁄9⁄90 / 2316-Sublaunching a Docum-Nov90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.6 KB  |  44 lines  |  [TEXT/GEOL]

  1. Item    5975034                         5-Nov-90        16:40PST
  2.  
  3. From:   LOCKWOOD                        Savitar, Mike Lockwood,PRT
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.  
  7. Sub:    Sublaunching a Document
  8.  
  9. Attn: MacApp Tech
  10. SentBy: Mike Lockwood
  11. Date   11/5/90
  12. Subject    Sublaunching a Document
  13. From   Mike Lockwood
  14. To MacApp Tech
  15.  
  16.        Reply to:Sublaunching a Document
  17. Under System 7, you can ask an application to open a document using the core
  18. AppleEvents such as 'odoc'.
  19.  
  20. Under System 6, it is a little trickier.  If the application is not currently
  21. running, you can sublaunch the application and then modify the AppParmHandle
  22. low memory global before calling WaitNextEvent.  The application then reads
  23. this handle using the CountAppFiles and GetAppFiles calls as documented in the
  24. Segment Loader chapter in Inside Mac vol II.
  25.  
  26. If the application is already running under MultiFinder 6.0, the situation is
  27. a little sticky.  When you double click on a document in the Finder, the
  28. Finder uses an undocumented OSDispatch call to tell MultiFinder to get the
  29. application to open the document.  MultiFinder then posts events and patches
  30. traps like MenuSelect and SFGetFile to imitate the user choosing the Open…
  31. menu item and selecting the file.  This does not work in applications with
  32. nonstandard File menus, as you have probably noticed.
  33.  
  34. I can send you some more info on this if you really want it, but I don't
  35. recommend this approach with System 6.  It requires undocumented toolbox calls
  36. and is unsupported.  I never got it working very well and gave up on it.
  37.  
  38. The System 7 solution is clean, and is probably the best way to go.
  39.  
  40. Mike
  41.  
  42.  
  43.  
  44.